var projectId = null;
var projectData = null;
var planId = null;
var modelId = null;
var planData = null;
var tabs = [];
var panel = null;
var paramList = [];
var listdata = [];
var listview = null;
var planIds = [];
var pageType_ ="";

function initPage(pageType) {
	if(sessionStorage.getItem("pageType_")){ 
		pageType_=sessionStorage.getItem("pageType_");
	}else{
		pageType_ =pageType;
	}
	if(pageType_ == "route"){
		$("#btnRoute").css("background-color","white");
		$("#btnMeos").css("width","150px");
		$("#btnMeos").css("background-color","#b0b6bd");
	}
	if(pageType_ == "meos"){
		$("#btnRoute").css("background-color","#b0b6bd");
		$("#btnMeos").css("width","115px");
		$("#btnMeos").css("background-color","white");
	}
	//showLoginInfo();
	var reg = new RegExp("(^|&)projectId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		projectId = param[2];
	} else {
		return;
	}
	
	var reg = new RegExp("(^|&)modelId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		modelId = param[2];
	} else {
		return;
	}
	if(modelId==9){
		$("#meostitle").text('运行仿真');
	}else{
		$("#meostitle").text('运行模拟');
	}
	projectData = getProject(projectId);
	if (!projectData || projectData.error) {
		showMsgBox("获取工程失败！",function(type) {
			return true;
		});
		return;
	}
	planData = getPlanList(projectId);
	if (!planData || planData.error) {
		showMsgBox("获取方案失败！",function(type) {
			return true;
		});
		return;
	}

	window.onmouseover = onMouseOver;
	window.onresize = onResize;

	$("#progressState").loadStep({
		size: "large",
      	color: "blue",
      	/*steps: [
      		{title: "新能源", content: "可再生能源运行模拟"},
      		{title: "水电",content: "长期水电运行模拟"},
      		{title: "检修",content: "检修运行模拟"},
      		{title: "日运行",content: "逐日运行模拟"},
      		{title: "计算结果",content: "导入计算结果"}
      	]*/
	steps: [
  		{title: "读入数据", content: "读入数据"},
  		{title: "建立约束",content: "建立约束"},
  		{title: "模型求解",content: "模型求解"},
  		{title: "计算结束",content: "计算结束"},
  		{title: "结果导入",content: "结果导入"}
  	]
    });
    $("#progressState").setStep(1);

	$('#btnPanel').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnAddPlan').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnCancel').click(function(){
		$('#wizardMask').hide();
		$('#planPanel').hide();
	});
	$('#btnFinish').click(function(){
		$("#inPlanName")[0].clearError();
		var inPlanName = $("#inPlanName")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanName")[0].setError("请填写方案名！");
			return;
		}
		var inPlanDemo = $("#inPlanDemo")[0].getValue();
		var result = createPlan(projectData.id, 9, inPlanName);
		if (!result || result.error) {
			if (result.itemName === "planName") {
				$("#inPlanName")[0].setError("方案名已经存在！");
				return;
			} else {
				showMsgBox("方案工程失败！",function(type) {
					return true;
				});
				return;
			}
		} else {
			planData = getPlanList(projectId);
			loadTreeView("");
			showMsgBox("新建方案成功！",function(type) {
				return true;
			});
		}
		$('#wizardMask').hide();
		$('#planPanel').hide();
	});

	$('#btnClose').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});
	$('#btnSave').click(function(){
		//调用保存设置参数的URL，并获取返回值
		var result = {error:"保存参数失败！"};
		if (!result || result.error) {
			showMsgBox("保存参数失败！",function(type){
				return true;
			});
			return;
		}
		$('#runPanel').hide();
	});
	
	$('#btnRoute').click(function(){
		if(sessionStorage.getItem("pageType_")) pageType_=sessionStorage.getItem("pageType_");
		if(pageType_ == "meos"){
			pageType_="route";
			if(modelId == 9){
				$("#contentPanel")[0].src = "../g/pages/meopMap.html?projectId="+projectId;

			}else{
				
				$("#contentPanel")[0].src = "../g/pages/routeMap.html?projectId="+projectId;
			}
			$("#btnRoute").css("background-color","white");
			$("#btnMeos").css("width","150px");
			$("#btnMeos").css("background-color","#b0b6bd");
		}
		sessionStorage.setItem("pageType_", 'route'); 
	});

	$('#btnMeos').click(function(){
		$('#buttonSave').click()
		if(sessionStorage.getItem("pageType_")) pageType_=sessionStorage.getItem("pageType_");

		if(pageType_ == "route"){
			
			$(".msgbox").hide()
			SaveConfirmMsgBox("", function(type) {
				if(type == "cancel"){
					$("#contentPanel")[0].src = "../pages/dataSourceToMeos.html?projectId="+projectId;
					$("#btnRoute").css("background-color","#b0b6bd");
					
					$("#btnMeos").css("width","115px");
					$("#btnMeos").css("background-color","white");
					pageType_="meos";
					sessionStorage.setItem("pageType_", 'meos'); 
				}else{
					$("#contentPanel")[0].contentWindow.doSave_()
					$("#contentPanel")[0].src = "../pages/dataSourceToMeos.html?projectId="+projectId;
					$("#btnRoute").css("background-color","#b0b6bd");
					
					$("#btnMeos").css("width","115px");
					$("#btnMeos").css("background-color","white");
					pageType_="meos";
					sessionStorage.setItem("pageType_", 'meos'); 
				}
			});
			 
		}
	});
	
	$('#btnRun').click(function(){
		planIds = [];
		/*var j = 0;
		var data = getPlanList(projectId);
		for (var i = 1; i < data.length; i++) {
			planIds[j] = data[i].id;
			j++;
		}*/
		planIds.push(planId)
		/*for(var i = 0 ; i <listview.nodes.length ; i++){
			if(listview.nodes[i].checkbox.checked == true){
				planIds[j] = listview.nodes[i].data.code;
				j++;
			}
		}*/
		$.ajax({
			async:false,
			url:'../pv/work/setParamsMEOP',
			type:'POST',
			dataType:'json',
			data:{"paramList":JSON.stringify(paramList),"planId":JSON.stringify(planIds)}
		});
			//展示进度窗口
			$('#progressDiv').show();
			$('#progressDiv').draggable();
			//循环查看状态
			var t = setInterval(function(){
				$.ajax({
					url: '../pv/executive/getProgressInfo',
					dataType: 'text'
				}).done(function(res) {
					var r = eval("("+res+")");
					$('#progressStrip').css({width:r.progressBar+"%"});
					$('#progressStrip').find("span").text(r.progressBar + "%");
					$('#progressText').html(r.result);
					$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
					$("#progressState").setStep(r.progressState);
				});
			}, 1000);
			
			$.ajax({
				dataType: "json",
				data:{planId:planId},
				url: "../pv/executive/implementExeMEOP"
			}).done(function(res) {
				clearInterval(t);
				$('#progressStrip').css({width:"100%"});
				$('#progressStrip').find("span").text("100%");
				$('#progressText').html(res.result);
				$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
				$("#progressState").setStep(5);
				
				$('#wizardMask').hide();
				$('#progressDiv').hide();
				
				$('#progressStrip').css({width:"0%"});
				$('#progressStrip').find("span").text("0%");
				$('#progressText').html("");
				$("#progressState").setStep(0);
			}).fail(function(data, status, xhr){
				clearInterval(t);
			});
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});
	$('#btnReturn').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});

	loadTreeView(pageType);
	getParams();
	loadRunPage();
	initCommonEvent();
	onResize();
	 
/*}
);*/
}


//展示登陆用户信息
function showLoginInfo(){
		$.ajax({
			url: '../pv/login/loginInfo',
			type: "get",
			success:function(res){
				result = res;
    			if (result != "") {
    				$("#login_name").text(result);
    			}else {
    				$("#login").text("登录/注册");
    				window.parent.location.href="login.html";
    				
    			}
		}
	})
}

function onResize() {
	console.log("onResize");
	resizeAddPlanPage();
	resizeRunPage();
};
function onMouseOver(e) {
	var event = e || window.event;
	var target = event.target;
	if (target.id == "headerMenu") {
		$("#treePanel")[0].style.visibility = "visible";
	} else {
		var treeNode = $(target).parents("#treePanel");
		if (target.id == "treePanel" || treeNode && treeNode.length > 0) {
		} else {
			$("#treePanel")[0].style.visibility = "hidden";
		}
	}
};

/*function onMenuClick(flag) {
	if (flag == 0) {
		loadTreeView("");
		$('#tabsDiv').css('display','block');
	} else if (flag == 1) {
		$('#tabsDiv').css('display','block');
		$('#wizardMask').show();
		$('#runPanel').show();
	} else if (flag == 2) {
		$('#tabsDiv').css('display','none');
		onResultClick();
	}
}*/

function onMenuClick(flag) {
	if (flag == 0) {
		loadTreeView("");
		$('#tabsDiv').css('display','block');
	} else if (flag == 1) {
		$('#wizardMask').show();
		$('#runPanel').show();
	} else if (flag == 2) {
		$('#tabsDiv').css('display','none');
		$("#contentPanel")[0].src = "../g/pages/dist/dist/index.html?projectId="+planId+"&modelId="+modelId;
	}else if (flag == 3) {
		window.location.href= "../pages/main2.html";
	}
}

var treeNodes = [];
function loadTreeView(pageType) {
	var treeProjectPanel = $('#treeProjectPanel')[0];
	var treeProjectIcon = $('#treeProjectIcon')[0];
	var treeProjectName = $('#treeProjectName')[0];
	var treePlanTree = $('#treePlanPanel')[0];

	treeProjectName.innerHTML = projectData.name;
	var textHeight = $('#treeProjectName').height();
	//var textHeight = RxCommon.getTextSize(treeProjectName, projectData.name).height;
	console.log("projectName.height = " + textHeight);
	treeProjectPanel.style.height = (textHeight+20) + "px";
	treeProjectIcon.style.top = ((textHeight+20-16)/2) + "px";
	treePlanTree.style.top = (95 + textHeight + 20) + "px";

	treePlanTree.dispose = RxCommon.dispose;
	treePlanTree.innerHTML = "";
	var top = 0;
	for (var i = 1; i < planData.length; i++) {
		var treeNode = RxCommon.ce(treePlanTree, null, "div", "tree_plan");
		var treeText = RxCommon.ce(treeNode, null, "div", "tree_plan_text");
		treeText.innerHTML = planData[i].name;
		textHeight = $(treeText).height();
		//textHeight = RxCommon.getTextSize(treeText, planData[i].name).height;
		console.log("planName.height = " + textHeight);
		treeNode.style.height = (textHeight+20) + "px";
		treeNode.style.top = (top) + "px";
		top = top + textHeight + 20;
		treeNode.selected = false;
		treeNode.text = treeText;
		treeNode.data = planData[i];
		treeNode.onmouseover = function() {
			this.className = "tree_plan_selected";
			this.text.className = "tree_plan_text_selected";
		};
		treeNode.onmouseout = function() {
			if (this.selected == false) {
				this.className = "tree_plan";
				this.text.className = "tree_plan_text";
			}
		};
		treeNode.onclick = function() {
			planId = this.data.id;
			for (var j = 0; j < treeNodes.length; j++) {
				if (this == treeNodes[j]) {
					$('#planNameList')[0].innerHTML = '当前方案：'+projectData.name+' > '+treeNodes[j].data.name;				
					treeNodes[j].selected = true;
					treeNodes[j].className = "tree_plan_selected";
					treeNodes[j].text.className = "tree_plan_text_selected";
					planId = treeNodes[j].data.id;
					onPlanClick(pageType);
				} else {
					treeNodes[j].selected = false;
					treeNodes[j].className = "tree_plan";
					treeNodes[j].text.className = "tree_plan_text";
				}
			}
		}
		treeNodes[treeNodes.length] = treeNode;
	}
	if (treeNodes.length > 0) {
		treeNodes[0].click();
	}
}

function onPlanClick (pageType) {
	 
	$("#contentPanel")[0].src = "../g/pages/dist/index.html?projectId="+projectId;

}
function iframeOnload () {
	JyyLoading.end();
}
function onResultClick () {
	console.log("projectId = " + projectId + ",planId" + planId);
	var iframe = document.getElementById("contentPanel");
	if (iframe.attachEvent){
        iframe.attachEvent("onload", function(){
            iframeOnload();
         });
    }else{
        iframe.onload = function(){
            iframeOnload();
        };
    }
	JyyLoading.start();
	//$("#contentPanel")[0].src = "http://www.cloudgopt.com/dactive/pages/report.jsp?projectId="+projectId+"&planId="+planId;
	$("#contentPanel")[0].src = "http://www.cloudgopt.com/dactive/pages/report.jsp?projectId="+projectId+"&planId="+planId;
}
function loadRunPage() {
	
	panel = $('#panelTab')[0];
	panel.dispose = RxCommon.dispose;
	createmeop();
}

function createmeop() {
	var group = createGroup("基本参数", 10, 20, 759, 150);
	panel.appendChild(group);
	
	 
	var label = RxLabel.init(null, "利率", {top:"28px",left:"90px",width:"80px",textAlign:"left"});
	var txtINTER_RATEChecked = 0.06;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].INTER_RATE)){
		 txtINTER_RATEChecked = paramList[0].INTER_RATE;
	}
	var txtV = RxText.init(null, txtINTER_RATEChecked, "", {top:"28px",left:"150px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].INTER_RATE = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
	
	label = RxLabel.init(null, "折现年数", {top:"28px",left:"430px",width:"80px",textAlign:"left"});
	var txtDISCOUNT_YEARChecked = 10;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DISCOUNT_YEAR)){
		 txtDISCOUNT_YEARChecked = paramList[0].DISCOUNT_YEAR;
	}
	txtV = RxText.init(null, txtDISCOUNT_YEARChecked, "", {top:"28px",left:"532px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DISCOUNT_YEAR = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
    label = RxLabel.init(null, "运行成本率", {top:"90px",left:"43px",width:"80px",textAlign:"left"});
	var txtOP_RATEChecked = 0.03;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].OP_RATE)){
		 txtOP_RATEChecked = paramList[0].OP_RATE;
	}
	var txtV = RxText.init(null, txtOP_RATEChecked, "", {top:"90px",left:"150px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].OP_RATE = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
	
	label = RxLabel.init(null, "规划小时数", {top:"90px",left:"415px",width:"80px",textAlign:"left"});
	var txtNPOINTChecked = 96;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].NPOINT)){
		txtNPOINTChecked = paramList[0].NPOINT;
	}
	txtV = RxText.init(null, txtNPOINTChecked, "", {top:"90px",left:"532px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].NPOINT = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
	
	
	

	group = createGroup("运行选项", 175, 20, 759, 150);
	panel.appendChild(group);
	
	
	label = RxLabel.init(null, "最大迭代次数", {top:"28px",left:"28px",width:"96px",textAlign:"left"});
	var txtMAX_ITERChecked = 100000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].MAX_ITER)){
		 txtMAX_ITERChecked = paramList[0].MAX_ITER;
	}
	var txtV = RxText.init(null, txtMAX_ITERChecked, "", {top:"28px",left:"150px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].MAX_ITER = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
	
	label = RxLabel.init(null, "最大计算时长", {top:"28px",left:"402px",width:"96px",textAlign:"left"});
	var txtTIMEOUTChecked = 60000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].TIMEOUT)){
		 txtTIMEOUTChecked = paramList[0].TIMEOUT;
	}
	txtV = RxText.init(null, txtTIMEOUTChecked, "", {top:"28px",left:"532px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].TIMEOUT = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
    label = RxLabel.init(null, "步长", {top:"90px",left:"93px",width:"80px",textAlign:"left"});
	var txtGAPChecked = 0.01;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].GAP)){
		 txtGAPChecked = paramList[0].GAP;
	}
	var txtV = RxText.init(null, txtGAPChecked, "", {top:"90px",left:"150px",width:"95px"},function(param){
		if(param.name == "onchange"){
			paramList[0].GAP = param.value;
		}
	});
	group.addView(label);
	group.addView(txtV);
	
}

function createDyxx() {
	var group = createGroup("水电运行方式", 10, 20, 310, 125);
	panel.appendChild(group);
	
	var chkSdyx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROLTHS)){
		if(paramList[0].DSED_HYDROLTHS == 1){
			chkSdyx1Checked = false;
		}
	}
	var chkSdyx1 = JyyCheckBox.init(null, chkSdyx1Checked, "0", "考虑中长期水电模拟", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_HYDROLTHS = 0;
		}else if(param.checked == false){
			paramList[0].DSED_HYDROLTHS = 1;
		}
	});
	group.addView(chkSdyx1);
	
	var rdoSdyx11Checked = true;
	var rdoSdyx12Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROSTYLE)){
		if(paramList[0].DSED_HYDROSTYLE == 1){
			rdoSdyx11Checked = false;
			rdoSdyx12Checked = true;
		}
	}
	var rdoSdyx11 = JyyRadio.init(null, "t2g1", rdoSdyx11Checked,  "0", "电量约束", {top:"45px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 0;
	});
	var rdoSdyx12 = JyyRadio.init(null, "t2g1", rdoSdyx12Checked, "1", "水量约束", {top:"45px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 1;
	});
	group.addView(rdoSdyx11);
	group.addView(rdoSdyx12);

	var rdoSdyx21Checked = false;
	var rdoSdyx22Checked = true;
	var rdoSdyx23Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROYEAR)){
		if(paramList[0].DSED_HYDROYEAR == 1){
			rdoSdyx21Checked = true;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = false;
		}else if(paramList[0].DSED_HYDROYEAR == 3){
			rdoSdyx21Checked = false;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = true;
		}
	}
	var rdoSdyx21 = JyyRadio.init(null, "t2g2", rdoSdyx21Checked,  "1", "枯水年", {top:"75px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 1;
	});
	var rdoSdyx22 = JyyRadio.init(null, "t2g2", rdoSdyx22Checked, "2", "平水年", {top:"75px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 2;
	});
	var rdoSdyx23 = JyyRadio.init(null, "t2g2", rdoSdyx23Checked, "3", "丰水年", {top:"75px",left:"220px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 3;
	});
	group.addView(rdoSdyx21);
	group.addView(rdoSdyx22);
	group.addView(rdoSdyx23);

	group = createGroup("核电选项", 145, 20, 310, 95);
	panel.appendChild(group);
	
	var rdoHdxx31Checked = true;
	var rdoHdxx32Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARSTYLE)){
		if(paramList[0].DSED_NUCLEARSTYLE == 1){
			rdoHdxx31Checked = false;
			rdoHdxx32Checked = true;
		}
	}
	var rdoHdxx31 = JyyRadio.init(null, "t2g3", rdoHdxx31Checked,  "0", "按额定容量运行", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 0;
	});
	var rdoHdxx32 = JyyRadio.init(null, "t2g3", rdoHdxx32Checked, "1", "调峰容量不足时考虑降出力运行", {top:"45px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 1;
	});
	group.addView(rdoHdxx31);
	group.addView(rdoHdxx32);

	group = createGroup("弃风/光与弃水选项", 250, 20, 310, 125, 135);
	panel.appendChild(group);
	
	var chkQfgs41Checked = true;
	var chkQfgs42Checked = false;
	var rdoQfgs41Checked = true;
	var rdoQfgs42Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILWINDPVORDER) && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILHYDROORDER)){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = false;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = false;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}
	}
	var chkQfgs41 = JyyCheckBox.init(null, chkQfgs41Checked, "1", "允许弃风/光", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			rdoQfgs41.checked = true;
			rdoQfgs42.checked = false;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			rdoQfgs41.checked = false;
			rdoQfgs42.checked = true;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}
	});
	var chkQfgs42 = JyyCheckBox.init(null, chkQfgs42Checked, "2", "允许弃水", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILHYDROORDER = 2;
			rdoQfgs41.checked = false;
			rdoQfgs42.checked = true;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILHYDROORDER = -1;
			rdoQfgs41.checked = true;
			rdoQfgs42.checked = false;
			rdoQfgs41.refresh();
			rdoQfgs42.refresh();
		}
	});
	group.addView(chkQfgs41);
	group.addView(chkQfgs42);
	var rdoQfgs41 = JyyRadio.init(null, "t2g4", rdoQfgs41Checked,  "0", "先弃风/光再弃水", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	var rdoQfgs42 = JyyRadio.init(null, "t2g4", rdoQfgs42Checked, "0", "先弃水再弃风/光", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	group.addView(rdoQfgs41);
	group.addView(rdoQfgs42);

	group = createGroup("抽蓄运行方式", 10, 350, 260, 125, 96);
	panel.appendChild(group);
	
	var rdoCxyx11Checked = false;
	var rdoCxyx12Checked = false;
	var rdoCxyx13Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPSTYLE)){
		if(paramList[0].DSED_PUMPSTYLE == 0){
			rdoCxyx11Checked = true;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 1){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = true;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 2){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = true;
		}
	}
	var rdoCxyx11 = JyyRadio.init(null, "t2g5", rdoCxyx11Checked,  "0", "优先做备用", {top:"15px",left:"20px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 0;
	});
	var rdoCxyx12 = JyyRadio.init(null, "t2g5", rdoCxyx12Checked, "1", "优先抽水发电", {top:"15px",left:"140px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 1;
	});
	var rdoCxyx13 = JyyRadio.init(null, "t2g5", rdoCxyx13Checked,  "2", "优先安排处理", {top:"45px",left:"20px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE =2;
	});
	group.addView(rdoCxyx11);
	group.addView(rdoCxyx12);
	group.addView(rdoCxyx13);
	
	group.addView(RxLabel.init(null, "调优容量比例", {top:"75px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtCxyx1Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPWEEKOPTRATIO)){
		txtCxyx1Checked = paramList[0].DSED_PUMPWEEKOPTRATIO*100;
	}
	var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"75px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PUMPWEEKOPTRATIO = param.value/100;
		}
	});
	group.addView(txtCxyx1);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"195px",width:"20px",textAlign:"left"}));

	group = createGroup("可再生能源运行方式", 145, 350, 260, 195,144);
	panel.appendChild(group);
	
	var rdoKzsny1Checked = true;
	var rdoKzsny2Checked = false;
	var rdoKzsny3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLESTYLE)){
		if(paramList[0].DSED_RENEWABLESTYLE == 0){
			rdoKzsny1Checked = true;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 1){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = true;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 2){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = true;
		}
	}
	var rdoKzsny1 = JyyRadio.init(null, "t2g6", rdoKzsny1Checked,  "0", "随机模拟处理", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 0;
	});
	var rdoKzsny2 = JyyRadio.init(null, "t2g6", rdoKzsny2Checked, "1", "", {top:"50px",left:"20px",width:"30px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 1;
	});
	group.addView(RxLabel.init(null, "外部指定能力（未指定时段", {top:"39px",left:"40px",width:"240px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "分仍进行随机模拟）", {top:"59px",left:"40px",width:"240px",textAlign:"left"}));
	var rdoKzsny3 = JyyRadio.init(null, "t2g6", rdoKzsny3Checked, "2", "固定出力", {top:"85px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 2;
	});
	group.addView(rdoKzsny1);
	group.addView(rdoKzsny2);
	group.addView(rdoKzsny3);
	group.addView(RxLabel.init(null, "峰时段出力", {top:"110px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtKzsny1Checked = 0;
	
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLEPEAKOUTPUT)){
		txtKzsny1Checked = paramList[0].DSED_RENEWABLEPEAKOUTPUT*100;
	}
	var txtKzsny1 = RxText.init(null, txtKzsny1Checked, "", {top:"110px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RENEWABLEPEAKOUTPUT = param.value/100;
		}
	});
	group.addView(txtKzsny1);
	group.addView(RxLabel.init(null, "%", {top:"110px",left:"195px",width:"20px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "谷时段处理", {top:"140px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtKzsny2Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DRENEWABLEVALLEYOUTPUT)){
		txtKzsny2Checked = paramList[0].DSED_DRENEWABLEVALLEYOUTPUT*100;
	}
	var txtKzsny2 = RxText.init(null, txtKzsny2Checked, "", {top:"140px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_DRENEWABLEVALLEYOUTPUT = param.value/100;
		}
	});
	group.addView(txtKzsny2);
	group.addView(RxLabel.init(null, "%", {top:"140px",left:"195px",width:"20px",textAlign:"left"}));

	group = createGroup("储能运行方式", 350, 350, 260, 100, 96);
	panel.appendChild(group);
	
	var chkCnyx1Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BBATTERYWEEK)){
		if(paramList[0].DSED_BBATTERYWEEK == 1){
			chkCnyx1Checked = true;
		}
	}
	var chkCnyx1 = JyyCheckBox.init(null, chkCnyx1Checked, "1", "考虑储能优化", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BBATTERYWEEK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BBATTERYWEEK = 0;
		}
	});
	group.addView(chkCnyx1);
	group.addView(RxLabel.init(null, "调优容量比例", {top:"45px",left:"40px",width:"100px",textAlign:"left"}));
	
	var txtCnyx1Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BATTERYWEEKOPTRATIO)){
		txtCnyx1Checked = paramList[0].DSED_BATTERYWEEKOPTRATIO*100;
	}
	var txtCnyx1 = RxText.init(null, txtCnyx1Checked, "", {top:"45px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_BATTERYWEEKOPTRATIO = param.value/100;
		}
	});
	group.addView(txtCnyx1);
	group.addView(RxLabel.init(null, "%", {top:"45px",left:"195px",width:"20px",textAlign:"left"}));

}

function createTfxx() {
	var chkTfxx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_IGNORERESERVE)){
		if(paramList[0].DSED_IGNORERESERVE == 0){
			chkTfxx1Checked = false;
		}
	}
	var chkTfxx1 = JyyCheckBox.init(null, chkTfxx1Checked, "1", "调峰或备用不足时去除备用", {top:"15px",left:"20px",width:"240px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_IGNORERESERVE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_IGNORERESERVE = 0;
		}
	});
	panel.appendChild(chkTfxx1);
	panel.appendChild(RxLabel.init(null, "当地谷符合小于高峰负荷", {top:"45px",left:"20px",width:"180px",textAlign:"left"}));
	
	var txtCxyx1Checked = 70;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DEEPREGULATIONLMT)){
		txtCxyx1Checked = (paramList[0].DSED_DEEPREGULATIONLMT*100).toFixed(2);
	}
		var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"45px",left:"200px",width:"50px"},function(param){
			if(param.name == "onchange"){
				paramList[0].DSED_DEEPREGULATIONLMT = param.value/100;
			}
		});
	panel.appendChild(txtCxyx1);
	panel.appendChild(RxLabel.init(null, "%时，启用如下深度调峰选项", {top:"45px",left:"255px",width:"220px",textAlign:"left"}));

	var group = createGroup("深度调峰选项", 75, 20, 525, 285, 96);
	panel.appendChild(group);
	
	var chkSdtf01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == -1){
			chkSdtf01Checked = false;
		}
	}
	var chkSdtf01 = JyyCheckBox.init(null, chkSdtf01Checked, "0", "燃机启停调峰", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GTSTOPORDER = 1;
			lstSdtf01.checkNode(1, true);
		}else if(param.checked == false){
			paramList[0].DSED_GTSTOPORDER = -1;
		}
	});
	group.addView(chkSdtf01);
	group.addView(RxLabel.init(null, "置燃机最小开机时间", {top:"45px",left:"20px",width:"160px",textAlign:"left"}));
	
	var txtSdtf01Checked = 6;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTMINONTIME)){
		txtSdtf01Checked = paramList[0].DSED_GTMINONTIME;
	}
	var txtSdtf01 = RxText.init(null, txtSdtf01Checked, "", {top:"45px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_GTMINONTIME = param.value;
		}
	});
	group.addView(txtSdtf01);
	group.addView(RxLabel.init(null, "小时", {top:"45px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"45px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf01 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_GTMINONTIME = data.node.data.code;
	});
	var drpSdtf01 = RxDropList.init(null, "", {list:lstSdtf01}, {position:'absolute', left:'440px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf01);
	var lstSdtf01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == 2){
			lstSdtf01Checked = 2;
		}else if(paramList[0].DSED_GTSTOPORDER == 3){
			lstSdtf01Checked = 3;
		}else if(paramList[0].DSED_GTSTOPORDER == 4){
			lstSdtf01Checked = 4;
		}
	}
	lstSdtf01.checkNode(lstSdtf01Checked, true);

	var chkSdtf02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == -1){
			chkSdtf02Checked = false;
		}
	}
	var chkSdtf02 = JyyCheckBox.init(null, chkSdtf02Checked, "0", "火电出力深度调峰", {top:"75px",left:"20px",width:"160px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALDEEPORDER = 2;
			lstSdtf02.checkNode(2, true);
		}else if(param.checked == false){
			paramList[0].DSED_THERMALDEEPORDER = -1;
		}
	});
	group.addView(chkSdtf02);
	group.addView(RxLabel.init(null, "火电机组最小负荷率", {top:"105px",left:"20px",width:"160px",textAlign:"left"}));
	
	var txtSdtf02Checked = 30;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALMINLOAD)){
		txtSdtf02Checked = paramList[0].DSED_THERMALMINLOAD*100;
	}
	var txtSdtf02 = RxText.init(null, txtSdtf02Checked, "", {top:"105px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALMINLOAD = param.value/100;
		}
	});
	group.addView(txtSdtf02);
	group.addView(RxLabel.init(null, "%", {top:"105px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"105px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf02 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_THERMALDEEPORDER = data.node.data.code;
	});
	var drpSdtf02 = RxDropList.init(null, "", {list:lstSdtf02}, {position:'absolute', left:'440px', top:'105px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf02);
	var lstSdtf02Checked = 2;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == 1){
			lstSdtf02Checked = 1;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 3){
			lstSdtf02Checked = 3;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 4){
			lstSdtf02Checked = 4;
		}
	}
	lstSdtf02.checkNode(lstSdtf02Checked, true);

	var chkSdtf03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == -1){
			chkSdtf03Checked = false;
		}
	}
	var chkSdtf03 = JyyCheckBox.init(null, chkSdtf03Checked, "0", "火电启停调峰", {top:"135px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALSTOPORDER = 3;
			lstSdtf03.checkNode(3, true);
		}else if(param.checked == false){
			paramList[0].DSED_THERMALSTOPORDER = -1;
		}
	});
	group.addView(chkSdtf03);
	group.addView(RxLabel.init(null, "机组容量不大于", {top:"165px",left:"20px",width:"120px",textAlign:"left"}));
	var txtSdtf03Checked = 300;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALCAPLMT)){
		txtSdtf03Checked = paramList[0].DSED_THERMALCAPLMT;
	}
	var txtSdtf03 = RxText.init(null, txtSdtf03Checked, "", {top:"165px",left:"138px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALCAPLMT = param.value;
		}
	});
	group.addView(txtSdtf03);
	group.addView(RxLabel.init(null, "MW参与启停", {top:"165px",left:"225px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"165px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf03 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_THERMALSTOPORDER = data.node.data.code;
	});
	var drpSdtf03 = RxDropList.init(null, "", {list:lstSdtf03}, {position:'absolute', left:'440px', top:'165px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf03);
	var lstSdtf03Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == 1){
			lstSdtf03Checked = 1;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 2){
			lstSdtf03Checked = 2;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 4){
			lstSdtf03Checked = 4;
		}
	}
	lstSdtf03.checkNode(lstSdtf03Checked, true);

	var chkSdtf04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == -1){
			chkSdtf04Checked = false;
		}
	}
	var chkSdtf04 = JyyCheckBox.init(null, chkSdtf04Checked, "0", "核电机组出力深度调峰", {top:"225px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_NUCLEARDEEPORDER = 4;
			lstSdtf04.checkNode(4, true);
		}else if(param.checked == false){
			paramList[0].DSED_NUCLEARDEEPORDER = -1;
		}
	});
	
	group.addView(chkSdtf04);
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"225px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf04 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_NUCLEARDEEPORDER = data.node.data.code;
	});
	var drpSdtf04 = RxDropList.init(null, "", {list:lstSdtf04}, {position:'absolute', left:'440px', top:'225px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpSdtf04);
	var lstSdtf04Checked = 4;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == 1){
			lstSdtf04Checked = 1;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 2){
			lstSdtf04Checked = 2;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 3){
			lstSdtf04Checked = 3;
		}
	}
	lstSdtf04.checkNode(lstSdtf04Checked, true);
}

function createJxxx() {
	var group = createGroup("机组检修", 10, 20, 580, 190);
	panel.appendChild(group);

	var rdoJxxx01Checked = false;
	var rdoJxxx02Checked = true;
	var rdoJxxx03Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx01Checked = true;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = false;
		}else if(paramList[0].DSED_RUNUMT == 2){
			rdoJxxx01Checked = false;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = true;
		}
	}
	var rdoJxxx01 = JyyRadio.init(null, "t5g1", rdoJxxx01Checked,  "0", "不考虑检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 0;
		rdoJxxx11.disable(true);
		rdoJxxx12.disable(true);
		rdoJxxx13.disable(true);
		rdoJxxx21.disable(true);
		rdoJxxx22.disable(true);
	});
	var rdoJxxx02 = JyyRadio.init(null, "t5g1", rdoJxxx02Checked, "1", "全局优化检修", {top:"15px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 1;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	var rdoJxxx03 = JyyRadio.init(null, "t5g1", rdoJxxx03Checked, "2", "启发式优化检修", {top:"15px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 2;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	group.addView(rdoJxxx01);
	group.addView(rdoJxxx02);
	group.addView(rdoJxxx03);

	group.addView(RxLabel.init(null, "检修目标：", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	
	var rdoJxxx11Checked = true;
	var rdoJxxx12Checked = false;
	var rdoJxxx13Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMETHOD)){
		if(paramList[0].DSED_UMTMETHOD == 1){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = true;
			rdoJxxx13Checked = false;
		}else if(paramList[0].DSED_UMTMETHOD == 2){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = false;
			rdoJxxx13Checked = true;
		}
	}
	var rdoJxxx11 = JyyRadio.init(null, "t5g2", rdoJxxx11Checked,  "0", "等备用", {top:"75px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 0;
	});
	var rdoJxxx12 = JyyRadio.init(null, "t5g2", rdoJxxx12Checked, "1", "等备用率", {top:"75px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 1;
	});
	var rdoJxxx13 = JyyRadio.init(null, "t5g2", rdoJxxx13Checked, "2", "等风险度", {top:"75px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 2;
	});
	rdoJxxx11.disable(false);
	rdoJxxx12.disable(false);
	rdoJxxx13.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx11.disable(true);
			rdoJxxx12.disable(true);
			rdoJxxx13.disable(true);
		}
	}
	group.addView(rdoJxxx11);
	group.addView(rdoJxxx12);
	group.addView(rdoJxxx13);

	group.addView(RxLabel.init(null, "检修方式：", {top:"105px",left:"20px",width:"100px",textAlign:"left"}));
	
	var rdoJxxx21Checked = true;
	var rdoJxxx22Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMEAN)){
		if(paramList[0].DSED_UMTMEAN == 1){
			rdoJxxx21Checked = false;
			rdoJxxx22Checked = true;
		}
	}
	var rdoJxxx21 = JyyRadio.init(null, "t5g3", rdoJxxx21Checked,  "0", "按等效检修天数安排", {top:"135px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMEAN = 0;
	});
	var rdoJxxx22 = JyyRadio.init(null, "t5g3", rdoJxxx22Checked, "1", "考虑机组大小修", {top:"135px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMEAN = 1;
	});
	rdoJxxx21.disable(false);
	rdoJxxx22.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx21.disable(true);
			rdoJxxx22.disable(true);
		}
	}
	group.addView(rdoJxxx21);
	group.addView(rdoJxxx22);

	group = createGroup("线路检修", 210, 20, 580, 68);
	panel.appendChild(group);
	//未找到对应字段
	var chkJxxx01 = JyyCheckBox.init(null, false, "0", "考虑线路检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		console.log(param);
	});
	group.addView(chkJxxx01);
}
function createSdyxxx() {
	var group = createGroup("水电运行方式", 10, 20, 580, 130, 96);
	panel.appendChild(group);
	
	var chkSdyx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRCOR)){
		if(paramList[0].LTHS_RESERVOIRCOR == 0){
			chkSdyx01Checked = false;
		}
	}
	var chkSdyx01 = JyyCheckBox.init(null, chkSdyx01Checked, "1", "考虑梯级电站协调", {top:"15px",left:"20px",width:"180px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRCOR = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRCOR = 0;
		}
	});
	group.addView(chkSdyx01);
	
	var chkSdyx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDROLIMIT)){
		if(paramList[0].LTHS_HYDROLIMIT == 0){
			chkSdyx02Checked = false;
		}
	}
	var chkSdyx02 = JyyCheckBox.init(null, chkSdyx02Checked, "1", "是否考虑跨流域之间协调", {top:"15px",left:"220px",width:"220px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDROLIMIT = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_HYDROLIMIT = 0;
		}
	});
	group.addView(chkSdyx02);
	
	var chkSdyx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_WATERMAX)){
		if(paramList[0].LTHS_WATERMAX == 0){
			chkSdyx03Checked = false;
		}
	}
	var chkSdyx03 = JyyCheckBox.init(null, chkSdyx03Checked, "1", "考虑水库最大用水量", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_WATERMAX = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_WATERMAX = 0;
		}
	});
	group.addView(chkSdyx03);
	group.addView(RxLabel.init(null, "出力总和最大出力", {top:"45px",left:"220px",width:"140px",textAlign:"left"}));
	
	var txtSdyx01Checked = 100;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITHIGH)){
		txtSdyx01Checked = paramList[0].LTHS_LIMITHIGH*100;
	}
	var txtSdyx01 = RxText.init(null, txtSdyx01Checked, "", {top:"45px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITHIGH = param.value/100;
		}
	});
	group.addView(txtSdyx01);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"45px",left:"440px",width:"80px",textAlign:"left"}));
	
	var chkSdyx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIREVAPO)){
		if(paramList[0].LTHS_RESERVOIREVAPO == 0){
			chkSdyx04Checked = false;
		}
	}
	var chkSdyx04 = JyyCheckBox.init(null, chkSdyx04Checked, "0", "考虑水库蒸发", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIREVAPO = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIREVAPO = 0;
		}
	});
	group.addView(chkSdyx04);
	group.addView(RxLabel.init(null, "出力总和最小出力", {top:"75px",left:"220px",width:"140px",textAlign:"left"}));
	
	var txtSdyx02Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITLOW)){
		txtSdyx02Checked = paramList[0].LTHS_LIMITLOW*100;
	}
	var txtSdyx02 = RxText.init(null, txtSdyx02Checked, "", {top:"75px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITLOW = param.value/100;
		}
	});
	group.addView(txtSdyx02);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"75px",left:"440px",width:"80px",textAlign:"left"}));

	group = createGroup("水电优化目标", 150, 20, 580, 65, 96);
	panel.appendChild(group);
	
	var rdoSdyx01Checked = true;
	var rdoSdyx02Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_GOALSTYLE)){
		if(paramList[0].LTHS_GOALSTYLE == 1){
			rdoSdyx01Checked = false;
			rdoSdyx02Checked = true;
		}
	}
	var rdoSdyx01 = JyyRadio.init(null, "t6g1", rdoSdyx01Checked,  "0", "考虑水电调峰效益", {top:"15px",left:"20px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 0;
	});
	var rdoSdyx02 = JyyRadio.init(null, "t6g1", rdoSdyx02Checked, "1", "水电发电量最大化", {top:"15px",left:"220px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 1;
	});
	group.addView(rdoSdyx01);
	group.addView(rdoSdyx02);

	group = createGroup("水电模拟选项", 225, 20, 580, 100, 96);
	panel.appendChild(group);
	
	var chkSdyx05Checked = true;
	var chkSdyx06Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM == 1){
			chkSdyx05Checked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM == 1){
			chkSdyx06Checked = false;
		}
	}
	var chkSdyx05 = JyyCheckBox.init(null, chkSdyx05Checked, "1", "是否考虑水电出力非线性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDRODIVNUM = 3;
		}else if(param.checked == false){
			paramList[0].LTHS_HYDRODIVNUM = 1;
		}
	});
	group.addView(chkSdyx05);
	var chkSdyx06 = JyyCheckBox.init(null, chkSdyx06Checked, "1", "是否考虑水头非线性", {top:"15px",left:"220px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRDIVNUM = 3;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRDIVNUM = 1;
		}
	});
	group.addView(chkSdyx06);
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"20px",width:"60px",textAlign:"left"}));
	
	var txtSdyx03Checked = 3;
	var txtSdyx04Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM != 1){
			txtSdyx03Checked = paramList[0].LTHS_HYDRODIVNUM;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM != 1){
			txtSdyx04Checked = paramList[0].LTHS_RESERVOIRDIVNUM;
		}
	}
	var txtSdyx03 = RxText.init(null, txtSdyx03Checked, "", {top:"45px",left:"75px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_HYDRODIVNUM = param.value;
		}
	});
	group.addView(txtSdyx03);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"163px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"220px",width:"60px",textAlign:"left"}));
	var txtSdyx04 = RxText.init(null, txtSdyx04Checked, "", {top:"45px",left:"275px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_RESERVOIRDIVNUM = param.value;
		}
	});
	group.addView(txtSdyx04);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"363px",width:"80px",textAlign:"left"}));
}

function createXnyyxxx() {
	var group = createGroup("风电选项", 10, 20, 580, 255);
	panel.appendChild(group);

	var cggroup = createGroup("常规选项", 25, 20, 240, 210);
	group.appendChild(cggroup);
	
	var chkFdxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WINDCORR)){
		if(paramList[0].WPOS_WINDCORR == 0){
			chkFdxx01Checked = false;
		}
	}
	var chkFdxx01 = JyyCheckBox.init(null, chkFdxx01Checked, "1", "考虑风电场空间相关性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WINDCORR = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WINDCORR = 0;
		}
	});
	cggroup.addView(chkFdxx01);
	
	var chkFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RELIABILITY)){
		if(paramList[0].WPOS_RELIABILITY == 0){
			chkFdxx02Checked = false;
		}
	}
	var chkFdxx02 = JyyCheckBox.init(null, chkFdxx02Checked, "1", "考虑风电机组可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkFdxx02);
	
	var chkFdxx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WAKEEFFECT)){
		if(paramList[0].WPOS_WAKEEFFECT == 0){
			chkFdxx03Checked = false;
		}
	}
	var chkFdxx03 = JyyCheckBox.init(null, chkFdxx03Checked, "1", "考虑风电场尾流效应", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WAKEEFFECT = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WAKEEFFECT = 0;
		}
	});
	cggroup.addView(chkFdxx03);
	
	var chkFdxx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_DAYRHYTHM)){
		if(paramList[0].WPOS_DAYRHYTHM == 0){
			chkFdxx04Checked = false;
		}
	}
	var chkFdxx04 = JyyCheckBox.init(null, chkFdxx04Checked, "1", "考虑风速日特性", {top:"105px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_DAYRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_DAYRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx04);
	
	var chkFdxx05Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_SEASONRHYTHM)){
		if(paramList[0].WPOS_SEASONRHYTHM == 0){
			chkFdxx05Checked = false;
		}
	}
	var chkFdxx05 = JyyCheckBox.init(null, chkFdxx05Checked, "1", "考虑风速季节特性", {top:"135px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_SEASONRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_SEASONRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx05);

	var msgroup = createGroup("风机功率特性曲线模式", 25, 280, 240, 100, 160);
	group.appendChild(msgroup);
	
	var rdoFdxx01Checked = false;
	var rdoFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_POWERCURVE)){
		if(paramList[0].WPOS_POWERCURVE == 0){
			rdoFdxx01Checked = true;
			rdoFdxx02Checked = false;
		}
	}
	var rdoFdxx01 = JyyRadio.init(null, "t7g1", rdoFdxx01Checked,  "0", "直线型", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 0;
	});
	msgroup.addView(rdoFdxx01);
	var rdoFdxx02 = JyyRadio.init(null, "t7g1", rdoFdxx02Checked, "1", "三次曲线型", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 1;
	});
	msgroup.addView(rdoFdxx02);

	var sjgroup = createGroup("随机数选项", 135, 280, 240, 100, 82);
	group.appendChild(sjgroup);
	
	var rdoFdxx11Checked = false;
	var rdoFdxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx11Checked = true;
			rdoFdxx12Checked = false;
		}
	}
	var rdoFdxx11 = JyyRadio.init(null, "t7g2", rdoFdxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 0;
		txtFdxx01.setReadOnly(true);
		rdoFdxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoFdxx11);
	var rdoFdxx12 = JyyRadio.init(null, "t7g2", rdoFdxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 1;
		txtFdxx01.setReadOnly(false);
		rdoFdxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoFdxx12);
	
	var txtFdxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMSEED)){
		txtFdxx01Checked = paramList[0].WPOS_RAMDOMSEED;
	}
	var txtFdxx01 = RxText.init(null, txtFdxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].WPOS_RAMDOMSEED = param.value;
		}
	});
	txtFdxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			txtFdxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtFdxx01);

	group = createGroup("光伏选项", 275, 20, 580, 145);
	panel.appendChild(group);

	cggroup = createGroup("常规选项", 25, 20, 240, 100);
	group.appendChild(cggroup);
	
	var chkGfxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_PVCORR)){
		if(paramList[0].PVOS_PVCORR == 0){
			chkGfxx01Checked = false;
		}
	}
	var chkGfxx01 = JyyCheckBox.init(null, chkGfxx01Checked, "1", "考虑风电场空间相关性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_PVCORR = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_PVCORR = 0;
		}
	});
	cggroup.addView(chkGfxx01);
	
	var chkGfxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RELIABILITY)){
		if(paramList[0].PVOS_RELIABILITY == 0){
			chkGfxx02Checked = false;
		}
	}
	var chkGfxx02 = JyyCheckBox.init(null, chkGfxx02Checked, "1", "考虑风电机组可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkGfxx02);

	sjgroup = createGroup("随机数选项", 25, 280, 240, 100, 82);
	group.appendChild(sjgroup);
	
	var rdoGfxx11Checked = false;
	var rdoGfxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx11Checked = true;
			rdoGfxx12Checked = false;
		}
	}
	var rdoGfxx11 = JyyRadio.init(null, "t7g3", rdoGfxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 0;
		txtGfxx01.setReadOnly(true);
		rdoGfxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoGfxx11);
	var rdoGfxx12 = JyyRadio.init(null, "t7g3", rdoGfxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 1;
		txtGfxx01.setReadOnly(false);
		rdoGfxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoGfxx12);
	
	var txtGfxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMSEED)){
		txtGfxx01Checked = paramList[0].PVOS_RAMDOMSEED;
	}
	var txtGfxx01 = RxText.init(null, txtGfxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].PVOS_RAMDOMSEED = param.value;
		}
	});
	txtGfxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			txtGfxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtGfxx01);
}

function createYhxx() {
	var group = createGroup("程序诊断选项", 10, 20, 300, 100, 96);
	panel.appendChild(group);
	
	var chkYhxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CONSOLE)){
		if(paramList[0].DSED_CONSOLE == 0){
			chkYhxx01Checked = false;
		}
	}
	var chkYhxx01 = JyyCheckBox.init(null, chkYhxx01Checked, "1", "显示控制台", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CONSOLE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_CONSOLE = 0;
		}
	});
	group.addView(chkYhxx01);
	group.addView(RxLabel.init(null, "控制台调试信息等级", {top:"45px",left:"40px",width:"150px",textAlign:"left"}));
	var lstYhxx01 = RxTree.init(null, [{code:0,name:0},{code:1,name:1},{code:2,name:2},{code:3,name:3}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_MSGLEV = data.node.data.code;
	});
	var drpYhxx01 = RxDropList.init(null, "", {list:lstYhxx01}, {position:'absolute', left:'190px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpYhxx01);
	
	var lstYhxx01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MSGLEV)){
		if(paramList[0].DSED_MSGLEV == 0){
			lstYhxx01Checked = 0;
		}else if(paramList[0].DSED_MSGLEV == 2){
			lstYhxx01Checked = 2;
		}else if(paramList[0].DSED_MSGLEV == 3){
			lstYhxx01Checked = 3;
		}
	}
	lstYhxx01.checkNode(lstYhxx01Checked, true);
	group = createGroup("程序优化核心选项", 120, 20, 300, 130, 128);
	panel.appendChild(group);
	group.addView(RxLabel.init(null, "计算时间限制", {top:"15px",left:"20px",width:"100px",textAlign:"left"}));
	
	var txtYhxx01Checked = 5;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TIMEOUT)){
		txtYhxx01Checked = paramList[0].DSED_TIMEOUT;
	}
	var txtYhxx01 = RxText.init(null, txtYhxx01Checked, "", {top:"15px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_TIMEOUT = param.value;
		}
	});
	group.addView(txtYhxx01);
	group.addView(RxLabel.init(null, "秒", {top:"15px",left:"230px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "最大迭代次数", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx02Checked = 3000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MAXITERATIONS)){
		txtYhxx02Checked = paramList[0].DSED_MAXITERATIONS;
	}
	var txtYhxx02 = RxText.init(null, txtYhxx02Checked, "", {top:"45px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_MAXITERATIONS = param.value;
		}
	});
	group.addView(txtYhxx02);
	group.addView(RxLabel.init(null, "次", {top:"45px",left:"230px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "优化计算间隙", {top:"75px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx03Checked = 0.01;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PRECISION)){
		txtYhxx03Checked = paramList[0].DSED_PRECISION;
	}
	var txtYhxx03 = RxText.init(null, txtYhxx03Checked, "", {top:"75px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PRECISION = param.value;
		}
	});
	group.addView(txtYhxx03);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"230px",width:"80px",textAlign:"left"}));
}

function createGroup(text, top, left, width, height, textWidth) {
	var ctrl = document.createElement("div");
	ctrl.className = "gopt_group";
	ctrl.style.top = top + "px";
	ctrl.style.left = left + "px";
	ctrl.style.width = width + "px";
	ctrl.style.height = height + "px";
	ctrl.panel = document.createElement("div");
	ctrl.panel.className = "gopt_group_panel";
	ctrl.appendChild(ctrl.panel);
	ctrl.text = document.createElement("div");
	ctrl.text.className = "gopt_group_text";
	ctrl.text.innerHTML = text;
	if (textWidth !== undefined) {
		ctrl.text.style.width = textWidth + "px";
	}
	ctrl.appendChild(ctrl.text);

	ctrl.addView = function(view) {
		ctrl.panel.appendChild(view);
	};

	return ctrl;
}

//模拟参数
var sps = {
	base:{//基本参数
		plan: [
			{
				id:0,
				name:"方案MMMMMM"
			}
		],
		etime: {//评估时间
			formDate:"2019-03-19",
			toDate:"2019-03-19"
		},
		scene: {//典型场景选择
			way:1,//0,1,2
			type:[1,1,1,1]
		}
	},
	run: {
	}
};
function resizeAddPlanPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#planPanel').css({top:((panelHeight-350)/2)+"px",left:((panelWidth-600)/2)+"px"});
}
function resizeRunPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#runPanel').css({top:((panelHeight-615)/2)+"px",left:((panelWidth-915)/2)+"px"});
	$('#runProcessPanel').css({top:((panelHeight-340)/2)+"px",left:((panelWidth-670)/2)+"px"});
}

function setChecked(obj, value){
	if(value == 1){
		obj.onclick();
	}
}

var timer = null;
var loopCount = 0;
function showProcessBar() {
	var n = 40;
	var arr =[];
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>【提示信息】计算完成！");
	arr.push("【提示信息】读入数据完毕,请稍后...<br/>【提示信息】建立约束...<br/>【提示信息】模型求解...<br/>【提示信息】计算完成！<br/>【提示信息】导入结果完成！");
	$('#progressDiv').show();
	loopCount = 0;
	timer = setInterval(function() {
		loopCount = loopCount + 1;
		var width = parseInt(loopCount*420/n);
		if (width > 420) {
			width = 420;
		}
		$('#runPanel').hide();
		$('#progressStrip').css({width:width});
    	$('#progressStrip').find("span").text(parseInt(width*100/420) +"%　");
		$('#progressText').html(arr[parseInt(width*100/420/20)-1]);
    	$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
    	$("#progressState").setStep(parseInt(width*100/420/20));
		
		if (loopCount > (n+6)) {
			hideProcessBar();
		}
	}, 500);
}
function hideProcessBar() {
	if (timer) {
		clearInterval(timer);
	}
	loopCount = 0;
	$('#progressStrip').css({width:"0%"});
	$('#progressStrip').find("span").text("0%");
	$('#progressText').html("");
	$("#progressState").setStep(0);
	$('#wizardMask').hide();
	$('#progressDiv').hide();
	onMenuClick(2);
}

function getParams(){
	$.ajax({
		async:false,
		url:"../pv/work/getParamsMEOP",
		type:"POST",
		data:{"projectid":planId},
		success:function(res){
			paramList = res.result
		}
	});
}
function invoke(url, args, callback){
	var r, op = {
			url: '../g/service/Meop/' + url,
			type:'POST',
			cache:false,
			async:true,
			dataType:'json',
			data:args ? JSON.stringify(args) : null,
			contentType:"application/json"
		};
	if(typeof callback == 'function'){
		op.success = function(data){
			if(data.error)return alert(data.error);
			callback(data);
		}
	} else {
		op.async = false;
		op.success = function(data){
			r = data
		};
	}
	$.ajax(op);
	if(r)if(r.error){
		alert(r.error);
		return null;
	}
	return r;
};
